home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 24 / CU Amiga Magazine's Super CD-ROM 24 (1998)(EMAP Images)(GB)(Track 1 of 2)[!][issue 1998-07].iso / CUCD / Programming / AMOSList / AMOSLIST / Zones.Asc < prev   
Encoding:
Text File  |  1998-05-09  |  1.5 KB  |  81 lines

  1. '************************
  2. '*\                    /*
  3. '*  Custom mouse zones  *
  4. '*/                    \*
  5. '************************
  6. '
  7. ' By Andrew Crowe
  8. '   andrewcrowe@enterprise.net 
  9. '
  10.  
  11. Rem      These set up the zones! 
  12.  
  13.  
  14. Dim ZO(7,3),AN(NRN,1),ANAL(2)
  15.  
  16. '
  17. 'ZO(n,0) = X1      ZO(n,1) = Y1      ZO(n,2) = X2     ZO(n,3) = Y2 
  18. '
  19. '  
  20. ZO(0,0)=40 : ZO(0,1)=48 : ZO(0,2)=148 : ZO(0,3)=68
  21. B=1
  22. ZO(B,0)=40 : ZO(B,1)=128 : ZO(B,2)=148 : ZO(B,3)=148
  23. B=2
  24. ZO(B,0)=40 : ZO(B,1)=152 : ZO(B,2)=148 : ZO(B,3)=172
  25. B=3
  26. ZO(B,0)=40+120 : ZO(B,1)=128 : ZO(B,2)=148+120 : ZO(B,3)=148
  27. B=4
  28. ZO(B,0)=40+120 : ZO(B,1)=152 : ZO(B,2)=148+120 : ZO(B,3)=172
  29. B=5
  30. ZO(B,0)=64 : ZO(B,1)=72 : ZO(B,2)=104 : ZO(B,3)=88
  31. B=6
  32. ZO(B,0)=64 : ZO(B,1)=88 : ZO(B,2)=96 : ZO(B,3)=104
  33. B=7
  34. ZO(B,0)=58 : ZO(B,1)=108 : ZO(B,2)=106 : ZO(B,3)=125
  35.  
  36.  
  37. Rem  This drawers some buttons 
  38.  
  39. For B=0 To 7
  40.    Ink B+6
  41.    Bar ZO(B,0),ZO(B,1) To ZO(B,2),ZO(B,3)
  42.    Ink 0
  43.    Box ZO(B,0),ZO(B,1) To ZO(B,2),ZO(B,3)
  44. Next 
  45.  
  46.  
  47. Print At(0,2);"Press the blue button to quit"
  48.  
  49.  
  50. Do 
  51.    
  52.    
  53.    
  54.    X=X Screen(X Mouse)
  55.    Y=Y Screen(Y Mouse)
  56.    
  57.    If Mouse Key
  58.       Print At(0,0);"                      "
  59.       
  60.       Rem   This checks all the buttons
  61.       
  62.       For A=0 To 7
  63.          If X>ZO(A,0) and Y>ZO(A,1) and X<ZO(A,2) and Y<ZO(A,3)
  64.             Print At(0,0);"You Pressed zone";A;" "
  65.             
  66.             Rem  Put button handeling code here  
  67.             
  68.             If A=0 : Rem  Blue = Quit 
  69.                End 
  70.             End If 
  71.             
  72.          End If 
  73.       Next 
  74.    End If 
  75.    
  76.    
  77.    Wait Vbl 
  78.    
  79. Loop 
  80.  
  81.